package com.cykj.web.controller.posbiz.entry.service.impl;

import com.cykj.common.core.domain.entity.SysUser;
import com.cykj.common.utils.SecurityUtils;
import com.cykj.pos.mapper.BizMerchantMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import org.apache.commons.lang3.StringUtils;
import com.cykj.web.controller.posbiz.entry.mapper.BizTopupBillsMapper;
import com.cykj.web.controller.posbiz.entry.domain.BizTopupBills;
import com.cykj.web.controller.posbiz.entry.service.IBizTopupBillsService;

import java.util.List;
import java.util.Map;

/**
 * 充值记录Service业务层处理
 *
 * @author zhj
 * @date 2021-11-11
 */
@Service
public class BizTopupBillsServiceImpl extends ServiceImpl<BizTopupBillsMapper, BizTopupBills> implements IBizTopupBillsService {
    @Autowired
    BizTopupBillsMapper bizTopupBillsMapper;

    @Override
    public List<BizTopupBills> queryLists(BizTopupBills bizTopupBills) {
        Map<String, Object> data= bizTopupBills.getParams();
        if (!data.isEmpty()){
            //map获取方式：Object beginTime=data.get("key");
            //获取data的beginTime和endTime
            Object beginTime=data.get("beginTime");
            Object endTime=data.get("endTime");
            //beginTime和endTime转换成string
            String beginTimestr= beginTime.toString();
            String endTimestr= endTime.toString();
            //放入到bizMerchTransactions里
            bizTopupBills.setBeginTime(beginTimestr);
            bizTopupBills.setEndTime(endTimestr);
        }
        return bizTopupBillsMapper.queryLists(bizTopupBills);
    }

    @Override
    public BizTopupBills checkById(Long billId) {
        return bizTopupBillsMapper.checkById(billId);
    }
    @Override
    public int removes(Long billId) {
        return bizTopupBillsMapper.removes(billId);
    }
}
